<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class DiscountMeal extends Model
{
    //优惠套餐
    protected $table = 'discount_meal';

    public function discount_info(){
        return $this->hasMany(DiscountInfo::class,'discount_id','id');
    }

    public function getDiscountCoveAttribute($value)
    {
        return getDomain().'/'.$value;
    }

    public function getCoveAttribute($value)
    {
        if(!empty($value)) {
            return getDomain() . '/' . $value;
        }else{
            return null;
        }
    }

    public function getVideoAttribute($value)
    {
        if(!empty($value)) {
            return getDomain() . '/' . $value;
        }else{
            return null;
        }
    }
}
